<?php
declare (strict_types = 1);

namespace app\common\model;

use think\Model;

/**
 * @mixin \think\Model
 */
class VipType extends BaseModel
{
    //

    public static function vipData()  {
        $res =self::with(['price'])->where(['status'=>PublicStatus::PUBLIC_STATUS_ONE])->limit(2)->select()->each(function($item,$key){
            $item['full_url'] = full_url($item['url']);
            return $item;
        })->toArray();
        return $res;
    }


    public function price()  {
        return $this->hasMany(VipPrice::class,'vip_type_id');
    }
}
